home *** CD-ROM | disk | FTP | other *** search
- Path: ecf2.puc.edu!bivey
- From: bivey@ecf2.puc.edu (Bruce Ivey)
- Newsgroups: comp.lang.c
- Subject: Re: swap high and low 16 bits?
- Date: 16 Jan 1996 05:55:36 GMT
- Organization: CRL Dialup Internet Access
- Message-ID: <4dfeko$phv@nntp.crl.com>
- References: <Pine.OSF.3.91.960115174921.19742A-100000@io.UWinnipeg.ca>
- NNTP-Posting-Host: ecf2.puc.edu
-
- Bill Simpson (wsimpson@uwinnipeg.ca) wrote:
- : I wanted to obtain a "random" starting number each time a program
- : is run. The obvious choice is time(NULL). The problem with it is that
- : if the program runs and terminates fairly quickly, the number returned by
- : time(NULL) is quite similar each run, differing only by the lowest bits.
-
- Why not use a combination of values obtained from your system's time of day
- instead of the time the program has been running? Unless the program is
- set to run at the same time every day, this should give good seeds.
-
-
- -----------------------------------------------------------------------------
- Bruce Ivey Dept of Physics & Computer Science Pacific Union College
- Angwin, CA 94508 bivey@puc.edu (707) 965-7269
- =============================================================================
-